Thread: overloading []

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    86

    overloading []

    when I am overloading the [] operators, do I declare them like so:

    operator[](string key){

    or like so:

    operator[string key]{

    ??

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    39
    operator[](string key)

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    the first one

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    thanx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help on understandind arrays
    By C++mastawannabe in forum C++ Programming
    Replies: 9
    Last Post: 06-16-2007, 10:50 PM
  2. Overloading [] operator for a vector
    By nappaji in forum C++ Programming
    Replies: 4
    Last Post: 05-01-2007, 10:44 AM
  3. Overloading [] and Assignment
    By Mastadex in forum C++ Programming
    Replies: 6
    Last Post: 12-24-2006, 12:22 PM
  4. crazy = and [] operator overloading question
    By jarro_2783 in forum C++ Programming
    Replies: 7
    Last Post: 09-15-2006, 08:56 PM
  5. Overloading the [] operator trouble
    By rmullen3 in forum C++ Programming
    Replies: 2
    Last Post: 08-01-2002, 12:46 PM